package com.zhanggm.zyk.auth.service.impl;

import com.zhanggm.zyk.auth.entity.TUser;
import com.zhanggm.zyk.auth.mapper.TUserMapper;
import com.zhanggm.zyk.auth.service.ITUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zhanggm
 * @since 2024-05-24
 */
@Service
public class TUserServiceImpl extends ServiceImpl<TUserMapper, TUser> implements ITUserService {


    public TUser getUserById(Integer id) {
        return this.getById(id);
    }

    public boolean isRole(Integer userId, String role) {
        TUser userById = getUserById(userId);
        return userById.getRole().equals(role);
    }

}
